<template>
  <div class="con">
    <div class="echarts" id="electric6Echarts"></div>
  </div>
</template>

<script>
export default {
  name: "electricBoxArea6",
  props: ["idInfo"],
  data() {
    return {
      option: {
        // backgroundColor: "#0B1535",
        textStyle: {
          // fontSize: 0,
          color:'#d94a4c',
        },
        xAxis: {
          nameTextStyle: {
            color: "#c0c3cd",
            // padding: [0, 0, -10, 0],
            fontSize: 14,
          },
          axisLabel: {
            color: "#8BA0C4",
            fontWeight: 400,
            fontFamily: "SourceHanSansCN-Regular, SourceHanSansCN",
            fontSize: 14,
          },
          axisTick: {
            lineStyle: {
              color: "#0B1535",
              width: 1,
            },
            show: false,
          },
          splitLine: {
            show: false,
          },
          axisLine: {
            lineStyle: {
              color: "#384267",
              // width: 1,
              type: "dashed",
            },
            show: true,
          },
          data: ["w1", "w2", "w3", "w4", "w5"],
          type: "category",
        },
        yAxis: {
          type: "value",
          nameTextStyle: {
            color: "#c0c3cd",
            // padding: [0, 0, -10, 0],
            fontSize: 14,
          },
          axisLabel: {
            color: "#8BA0C4",
            fontFamily: "SourceHanSansCN-Regular, SourceHanSansCN",
            fontSize: 14,
          },
          axisTick: {
            lineStyle: {
              color: "#384267",
              // width: 1,
            },
            show: true,
          },
          splitLine: {
            show: true,
            lineStyle: {
              color: "#384267",
              type: "line",
            },
          },
          axisLine: {
            lineStyle: {
              color: "#fff",
              // width: 1,
              type: "line",
            },
            show: false,
          },
        },
        series: [
          {
            data: [22.0, 21.3, 19, 19, 18.8],
            type: "bar",
            barMaxWidth: "auto",
            barWidth: 23,
            itemStyle: {
              color: {
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                type: "linear",
                global: false,
                colorStops: [
                  {
                    offset: 0,
                    color: "#d92f1c",
                  },
                  {
                    offset: 1,
                    color: "#d97d79",
                  },
                ],
              },
            },
            label: {
              show: true,
              position: "top",
              distance: 10,
              color: "#d96200",
              fontSize: 15,
            },
          },
        ],
      },
    };
  },
  methods: {},
  mounted() {
    setTimeout(() => {
      const myCharts = this.$echarts.init(
        document.getElementById("electric6Echarts")
      );
      myCharts.setOption(this.option);
    }, 500);
  },
};
</script>

<style lang="scss" scoped>  
.con {
  .echarts {
    width: 435px;
    height: 240px;
  }
}
</style>